Skip to main content

Get Last Transaction

The Get Last Transaction API allows the user to retrieve the most recent transaction processed by a specific terminal. This is useful for the cashier to verify the latest payment activity, status tracking, etc.

Endpoint 

Method: GET

URL: baseUrl/api/v1/transactions/latest

Heades

  • Authorization: Bearer {{accessToken}} (Include the token obtained from the Authentication API)
  • Content-Type: application/json

Sample Response

{  
  "id": 997,
  "amount": 10000,
  "status": "INITIALIZED",
  "terminal": 68,
  "date": "2025-07-03T12:36:03.479506",
  "rrn": "316603000042",
  "cardType": "mada",
  "terminalId": "1234567812121250",
  "acquirerCode": "RYDB",
  "merchantAr": "إختبار مدى",
  "merchantEn": "mada Test",
  "addAr": "العليا,الرياض",
  "addEn": "Al-Olaya, Riyadh",
  "merchantId": "800150400566",
  "merchantCategoryCode": "5411",
  "stan": "000042",
  "madaAppVersion": "1.2.51",
  "cardSchemeAr": "مدى",
  "cardSchemeEn": "mada",
  "transactionTypeAr": "شراء",
  "transactionTypeEn": "PURCHASE",
  "pan": "535825******5490",
  "cardExpiration": "2409",
  "amountAuthorizedValue": "900",
  "amountAuthorizedAr": "ريال",
  "amountAuthorizedEn": "SAR",
  "statusMessageAr": "مقبولة",
  "statusMessageEn": "APPROVED",
  "verificationMethodAr": "لا يتطلب التحقق",
  "verificationMethodEn": "NO VERIFICATION REQUIRED",
  "approvalCodeAr": null,
  "approvalCodeEn": null,
  "approvalCodeValue": "803774",
  "endDate": null,
  "endTime": null,
  "thanksMessageAr": null,
  "thanksMessageEn": null,
  "saveReceiptMessageAr": null,
  "saveReceiptMessageEn": null,
  "entryMode": "CONTACTLESS",
  "actionCode": "000",
  "applicationIdentifier": "A0000002281010",
  "terminalVerificationResult": "0400000801",
  "transactionStateInformation": "0000",
  "cardholaderVerficationResult": "1F0302",
  "cryptogramInformationData": "6DDF1F910E6855F7",
  "applicationCryptogram": null,
  "kernelId": "02",
  "paymentAccountReference": null,
  "cashierName": "CashierAmnk",
  "branchName": "العليا الرئيسي",
  "providerResponseCode": null,
  "uuid": "153f2c54-45c2-3c3e-a4b0-d1bf1528343a"
}

Attributes Reference Table  

FieldTypeDescription
idIntegerTransaction ID in the database
amountIntegerTransaction amount in sub-units (e.g., halalas)
statusStringCurrent transaction status (e.g., INITIALIZED, APPROVED)
dateTimestampDate and time the transaction was initiated
rrnStringRetrieval Reference Number (RRN)
terminalIdStringUnique identifier of the POS terminal
acquirerCodeStringCode of the acquiring bank
merchantEnStringMerchant name (English)
merchantArStringMerchant name (Arabic)
addEnStringMerchant address (English)
addArStringMerchant address (Arabic)
merchantIdStringMerchant ID assigned by the bank/acquirer
cardTypeStringCard type used in transaction (e.g., mada, Visa)
cardSchemeEnStringCard scheme in English (e.g., mada)
transactionTypeEnStringType of transaction (e.g., PURCHASE)
panStringMasked Primary Account Number
approvalCodeValueStringApproval code from acquirer
entryModeStringMethod of card entry (e.g., CONTACTLESS, CHIP)
statusMessageEnStringResult message for the transaction
verificationMethodEnStringHow cardholder was verified
cashierNameStringName of the cashier handling the transaction
branchNameStringMerchant branch where transaction occurred
uuidUUIDUnique identifier of transaction for traceability

Usage Tips

  • This API is ideal for fetching receipt data after a successful transaction, or for reconfirming recent POS activity.
  • If a transaction does not appear as confirmed on the client app due to a connectivity issue, Use the status and statusMessageEn fields to validate transaction success before printing receipts or showing confirmation.
  • Be sure to securely store or display the masked PAN only (e.g., 535825******5490), never the full card number.